home *** CD-ROM | disk | FTP | other *** search
- /* Windows Initialization Files -- sample source code Listing 2
- * Kevin H. Carlson 8/07/91
- */
-
-
- .
- .
- .
- char commPort[5];
- int commBaud;
- char commParity[2];
- int commDataBits;
- int commStopBits;
- char commXferType[7];
- char lpCommSection[] = "Comm";
-
-
- .
- .
- .
- /* GetProfileString returns the number of characters copied into the
- * result buffer */
- GetProfileString((LPSTR) lpCommSection,/* Section name */
- (LPSTR) "Port", /* Key name */
- (LPSTR) "COM1", /* Default */
- (LPSTR) commPort, /* Result Buffer */
- (LPSTR) sizeof(commPort));/* Size of Buffer including null */
-
- /* GetProfileInt returns type WORD */
- commBaud = GetProfileInt((LPSTR) lpCommSection,/* Section name */
- (LPSTR) "BaudRate",/* Key name */
- 2400); /* Default */
-
- GetProfileString((LPSTR) lpCommSection, (LPSTR) "Parity", (LPSTR) "N",
- (LPSTR) commParity, (LPSTR) sizeof(commParity));
-
- commDataBits = GetProfileInt((LPSTR) lpCommSection, (LPSTR) "DataBits", 8);
-
- commStopBits = GetProfileInt((LPSTR) lpCommSection, (LPSTR) "StopBits", 1);
-
- GetProfileString((LPSTR) lpCommSection, (LPSTR) "XferType", (LPSTR) "YModem",
- (LPSTR) commXferType, (LPSTR) sizeof(commXferType));
-
- .
- .
- .
-